UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5TGaep7TZPuH4eRWeQrm4FNaE4XMPZWsPgJcbgVMBSA=' 
WHERE 
  key_id = '46185f830ba3da6951b7777d20d1a4c3ddf5b6f339fe1cfd4ca46f666ecee94b' 
  AND (
    token = '5TGaep7TZPuH4eRWeQrm4FNaE4XMPZWsPgJcbgVMBSA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047