UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'R4zkQBxv9Si1Q4V95ByIWjblDKB8wsqU+fnLoDgTpyo=' 
WHERE 
  key_id = 'f71a8c36560739bc63f8a3675b8f06866d6e459dd4dea3377ee4b801b460f22c' 
  AND (
    token = 'R4zkQBxv9Si1Q4V95ByIWjblDKB8wsqU+fnLoDgTpyo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00193