UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mSGX9dFsEiQT+UF4f8IJy78YGrD4Q2u4lmi1gmDL31o=' 
WHERE 
  key_id = '4bae0b9ca91a2fb2455e6608102bbdd6eb7c0d8fc9cdf4d0e871ec6f01e6f9b9' 
  AND (
    token = 'mSGX9dFsEiQT+UF4f8IJy78YGrD4Q2u4lmi1gmDL31o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041