UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VF7qdvBX5akgF7NSY2g49oFyWI4DlohBV329tLsejYE='
WHERE
key_id = '602ad5f90dd649e485b5dff74b2cb151be59716dd1e3a44e91752d8a624f70b6'
AND (
token = 'VF7qdvBX5akgF7NSY2g49oFyWI4DlohBV329tLsejYE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)