UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Y/ocIc4JhmT/q6raXqSroHsjT1O6ugTxMn44aC7B0nA='
WHERE
key_id = 'c2f15c886ecc7ea0c1965cd9fe3490a294171612a25457f2832c730e2f35588c'
AND (
token = 'Y/ocIc4JhmT/q6raXqSroHsjT1O6ugTxMn44aC7B0nA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)