UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'C82wFt6TA2TeX/Hl0MGFtRxepVK8Yh/4CGk21snE8eM=' 
WHERE 
  key_id = 'cc7e41478c58eaef036a3aa78bbd17baf597470ca1da88f2fc6eb7b1f931ae91' 
  AND (
    token = 'C82wFt6TA2TeX/Hl0MGFtRxepVK8Yh/4CGk21snE8eM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023