UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'X3yuDyVw9boAoWzCL649ZsFLNhFvCkfhA/Dyb2oO6vw='
WHERE
key_id = 'b1a762bc5e75ea3822dcd419cff0298afb44325f87df408f10ebb5e75a5e86d2'
AND (
token = 'X3yuDyVw9boAoWzCL649ZsFLNhFvCkfhA/Dyb2oO6vw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)