UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'S5YKRL9ZUMm9ACkCfq9L/ZfJdzAUWIVS9JbHskFDb5E='
WHERE
key_id = '5d02efde77733ce9a1cd6655eb6eacc3d2af4cdabf0e130e4ca730b5603f3d50'
AND (
token = 'S5YKRL9ZUMm9ACkCfq9L/ZfJdzAUWIVS9JbHskFDb5E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)