UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'bOD/6zzVqDVXDqy63awFzYAyiTMLzgW42okqLZrF//s=' 
WHERE 
  key_id = '25c0f56a598c8fe0b37a8e78eeb804545e0e195b80e0924cd22f90d5886e7f77' 
  AND (
    token = 'bOD/6zzVqDVXDqy63awFzYAyiTMLzgW42okqLZrF//s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00054