UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+jQh1dH0jXJZjvC5aL7JPAbmkRrzp62TVIbqzHOy914='
WHERE
key_id = '3b0b959093c9b2afab1c9e583a7a20133da514f099ab4ecff1f33d83d9b9504c'
AND (
token = '+jQh1dH0jXJZjvC5aL7JPAbmkRrzp62TVIbqzHOy914='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)