UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'G/phq5rmvIDyAw0wSldyVSWZ97Ys6PmwoOlfcsXmZXo='
WHERE
key_id = 'aa72e52f198b53239c15da1710d70d5cdd8bbe336d8813e7f94e5e1392e7c64c'
AND (
token = 'G/phq5rmvIDyAw0wSldyVSWZ97Ys6PmwoOlfcsXmZXo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)