UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qjbAEs4lqkev56fETynVnvfl/gbHclowlYavugDqnR8='
WHERE
key_id = 'e77c13ffadddf047b7dd249526fb621490ccc6940294e581353cb98f3ae7d87f'
AND (
token = 'qjbAEs4lqkev56fETynVnvfl/gbHclowlYavugDqnR8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)