UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'OPwq8vTOIwCvGh1OLJChArcT1mNSN25iv7Ed6HjXLnU=' 
WHERE 
  key_id = '7693f1c571e42fa9a48126441c581d4bbb0080116cae6c1b01a5e665b4b3e6c7' 
  AND (
    token = 'OPwq8vTOIwCvGh1OLJChArcT1mNSN25iv7Ed6HjXLnU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031