UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nQPs4o7WQIKsvoD/85vN9bgnSRkP9Ca3noY7v+oy0l0='
WHERE
key_id = '4e421744c889533d257257ed7f0b01565d6f308e16e77b187799be13fc163ac5'
AND (
token = 'nQPs4o7WQIKsvoD/85vN9bgnSRkP9Ca3noY7v+oy0l0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)