UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'iJ1+T2eLLb3MdvgFvFSGTEM2P49V0QXR+rAD68311pY='
WHERE
key_id = 'e2fe3160d3d277a5014aa63e1549e46589fc9d8c7f7cdd61e9beb30e048ac404'
AND (
token = 'iJ1+T2eLLb3MdvgFvFSGTEM2P49V0QXR+rAD68311pY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)