UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'eEjPGV47X+q3Fdrx76kEJ2FPTMXat1DS0ztvxC1GD+0='
WHERE
key_id = '524ab3dcb05e799581823b5399d9a440b039beb40c1ab8bab0d8247842202560'
AND (
token = 'eEjPGV47X+q3Fdrx76kEJ2FPTMXat1DS0ztvxC1GD+0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)