UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'cu1tSgLwL2p/GylAe8qOojGfL/KYnzZ6VqYxv7aC6lg=' 
WHERE 
  key_id = '2efa922ae2edbffeea8026f15b3ccef3a380448ff3666701c85a5ee7f1b09339' 
  AND (
    token = 'cu1tSgLwL2p/GylAe8qOojGfL/KYnzZ6VqYxv7aC6lg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042