UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'F9IxVhirJMK4d5Hh1fpAjru3yQwb6GRGi8jBuy2oNsw=' 
WHERE 
  key_id = '75f99b900e42701b2988a5806b620057c547e7e13162b18d74b0349ccef275da' 
  AND (
    token = 'F9IxVhirJMK4d5Hh1fpAjru3yQwb6GRGi8jBuy2oNsw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047