UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mIHnIB/Hl/riJHbbH0ROagniUsHkDxTgx0jOpSFnNyA=' 
WHERE 
  key_id = 'd10f8021a619d73c500553602a6eab826d3f3b5affb52fd15cf45b7f6e744fbe' 
  AND (
    token = 'mIHnIB/Hl/riJHbbH0ROagniUsHkDxTgx0jOpSFnNyA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035