UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'puk/bq2F32ZZKdiDhYINgWoDwE9rvAYXocpKX9EGVMI=' 
WHERE 
  key_id = '63d45bce0caac0012589d41c552af99367c19c897d779a4af13581b8c7e47f1d' 
  AND (
    token = 'puk/bq2F32ZZKdiDhYINgWoDwE9rvAYXocpKX9EGVMI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031