UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UYqUODggoF18x1Qj6VxcyNT5afiU9mOp7zEAOA2tKNA='
WHERE
key_id = '585967ba7c626daead23ad7cc85febe61ecfb8300bb64f349cd7d2c1fbcf440c'
AND (
token = 'UYqUODggoF18x1Qj6VxcyNT5afiU9mOp7zEAOA2tKNA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)