UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DbrK6lMGMiuE/wZgFAFiEr61f5vW7TJ1RA1fAf8N86c=' 
WHERE 
  key_id = '6a1276261b857c7eaaacb45f485e5c077fe4bb0a6a852495af0a857227178858' 
  AND (
    token = 'DbrK6lMGMiuE/wZgFAFiEr61f5vW7TJ1RA1fAf8N86c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037