UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lOb+GUcZoYgxBtktgBwugoyjwpNcbwTAsqlVROmONpg='
WHERE
key_id = '7c012ccf397adbaf7862e2525f72c220243bccb4e3eb688dc9132b6d8a811695'
AND (
token = 'lOb+GUcZoYgxBtktgBwugoyjwpNcbwTAsqlVROmONpg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)