UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'l5CQnYxsOuuWbZ7E6PKg+AjTJHNVoISY5VZgJerEVTs=' 
WHERE 
  key_id = '71fe6b9ae5301f9411b8021893b4077d1b75f0e7194625ce80f713c0e6ca8fab' 
  AND (
    token = 'l5CQnYxsOuuWbZ7E6PKg+AjTJHNVoISY5VZgJerEVTs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043