UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6i3HqN54llk+X60kNFUxoD0fkYNoGgbsOW/iWz0Vwqk='
WHERE
key_id = 'e5cf6381ed53e9a5983736b66e606b8d3dd9392f8bbbfebdd8fb570da61ba95c'
AND (
token = '6i3HqN54llk+X60kNFUxoD0fkYNoGgbsOW/iWz0Vwqk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)