UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fZaFbUk4y8o62SESoksx0thzK/kmiNDxkewGYy6qjgU='
WHERE
key_id = '3bd561b556668fbfbda656cb701d5399ab73b16e7052d27cc5bd5d50dc2158ad'
AND (
token = 'fZaFbUk4y8o62SESoksx0thzK/kmiNDxkewGYy6qjgU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)