UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'D1uN/VHMFKxaoyZP+kF6PYK7ifqTEUgq28of9oacpRs=' 
WHERE 
  key_id = '8f52b264233889607f88b153eb54350356a7763cbbe9c3d44fff7cea3b5f1eaf' 
  AND (
    token = 'D1uN/VHMFKxaoyZP+kF6PYK7ifqTEUgq28of9oacpRs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019