UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0QAECVrc75LrbjImsNZENYt1/MpZiyQsa8gsjGq67fA=' 
WHERE 
  key_id = '2d33eb049caedcf2252016ed0809e9fa26c24a5c05e3c13921045eaf5d2c5fda' 
  AND (
    token = '0QAECVrc75LrbjImsNZENYt1/MpZiyQsa8gsjGq67fA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041