UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7l6Uoui9wm78nlEmGi+hL8Y+1o5PnEE6gSBvEHG9ipE='
WHERE
key_id = 'a027c719fbc3a354224b29736ffd61f3667d8d072a2df151dc6421bfb1b0fada'
AND (
token = '7l6Uoui9wm78nlEmGi+hL8Y+1o5PnEE6gSBvEHG9ipE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)