UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'iigbU2Jfo88sqDUg01MvzqAumqZxZxngcYurH9gvFng=' 
WHERE 
  key_id = 'd8b6b437039dcdcaa44da573cfe7abe3cf46f9c59cf8264ed45610a34d485fb0' 
  AND (
    token = 'iigbU2Jfo88sqDUg01MvzqAumqZxZxngcYurH9gvFng=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00078