UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EUrgN6BiBdBVIFD8/AnjsotfvzPIy3rKhtpctZbotCY=' 
WHERE 
  key_id = '41f6764f138a20f3f3ead77379eb9cbbc474ad5bb50a444c78439874d766f1f9' 
  AND (
    token = 'EUrgN6BiBdBVIFD8/AnjsotfvzPIy3rKhtpctZbotCY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035