UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fRgMTcGxzGuw47JFMPdeV+VNoxD7bOfbFHtRY9C/igo=' 
WHERE 
  key_id = '9b50d708f8e75b39a2ac4b2046cb37feec59cbc5970fc48a72d53866cd3b0a85' 
  AND (
    token = 'fRgMTcGxzGuw47JFMPdeV+VNoxD7bOfbFHtRY9C/igo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044