UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'AquwMpQVXe2+CIMrX6IY5Zht6UUuwUJ11rbrWJ9Gl5I=' 
WHERE 
  key_id = 'fadd3bbfd1b8c0a1d2218a5b79c05140e799e4ebf4df2e0ef7751cc9f01ede62' 
  AND (
    token = 'AquwMpQVXe2+CIMrX6IY5Zht6UUuwUJ11rbrWJ9Gl5I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026