UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ZhZpkdgCkUlSF2v81PGx0IJX6IsYG5xyvT9WzO9TJpE=' 
WHERE 
  key_id = '25f7f393d0bb67f89e8ce689c915174d9cad4c66f04769a8ff198e388bf33828' 
  AND (
    token = 'ZhZpkdgCkUlSF2v81PGx0IJX6IsYG5xyvT9WzO9TJpE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032