UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'BIvbV+pF+pman1YeNK0XXCxVqorsMXxFb038ioJWtD4=' 
WHERE 
  key_id = '6819d5d00267fae39561b7ac002bc1c1128ccb0fabb42fe6efa10daf0a95b772' 
  AND (
    token = 'BIvbV+pF+pman1YeNK0XXCxVqorsMXxFb038ioJWtD4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041