UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3SvNktxkJ0Bd9MyFJCbWyJ8S8dr298R+M/fDxsyoSmk=' 
WHERE 
  key_id = 'dd7acd4e16ebf6ca69b8e3112ada5f8b72197f2dec742464808d1c85e0922dae' 
  AND (
    token = '3SvNktxkJ0Bd9MyFJCbWyJ8S8dr298R+M/fDxsyoSmk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034