UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'PxQjHhdbfqR9cNqYVhNE3c+mcshyS+fNpTXDX4wZeh8=' 
WHERE 
  key_id = 'a81fde235049e4f292304d372d4009f55e10591692af7b215a5bd261f76dad09' 
  AND (
    token = 'PxQjHhdbfqR9cNqYVhNE3c+mcshyS+fNpTXDX4wZeh8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021