UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ApGLJS+/DxXAwaKvfwCvGmANQ8NYBka1Lnp3PP4Bkjc=' 
WHERE 
  key_id = '41f2418b8dbf1bfe1d862e49f54f60479b72fdd2a02086cbf69ee84dbd6d36a3' 
  AND (
    token = 'ApGLJS+/DxXAwaKvfwCvGmANQ8NYBka1Lnp3PP4Bkjc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00056