UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8vEqloPe8xVG5WoB2iKZtj7ECsdPGcE9Hz06bMXLxR0='
WHERE
key_id = '18053df689cb4ba58b6572c263099a90d25dac599c0424eba41393e103a967af'
AND (
token = '8vEqloPe8xVG5WoB2iKZtj7ECsdPGcE9Hz06bMXLxR0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)